package com.bolins.util;

import java.text.NumberFormat;

public class MatrixingFromPoint {

	/**
	 * 点与货币换算
	 * @param point     点     
	 * @param rate      指定货币与点之间的比率
	 * @return
	 */
	public static  String getFormatFloatValue(int point,int rate){
		
		
		if(rate == 1)return point+"";
		String str = "";
		float curbalance = (float)point/(float)rate;	
	    NumberFormat   numFormat   =   NumberFormat.getNumberInstance();  
        numFormat.setMaximumFractionDigits(3);   
        str  =  numFormat.format(curbalance);
        
        int digits = 3;
        while (str.equals("0") && digits < 10) {
            numFormat.setMaximumFractionDigits(digits ++);   
            str  =  numFormat.format(curbalance);
        }
        
		return str;
	}
}
